home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / libs / muitoolkit-src.lha / muitoolkit-2.1_src / include / libraries / muitoolkit.h next >
Encoding:
C/C++ Source or Header  |  2001-09-16  |  4.6 KB  |  150 lines

  1. /*
  2. ** $Id: muitoolkit.h,v 1.8 2001/01/14 10:46:31 carlos Exp $.
  3. **
  4. ** (C) Copyright 1999-2001 Marcin Orlowski <carlos@amiga.com.pl>
  5. ** All Rights Reserved.
  6. */
  7.  
  8. #ifndef LIBRARIES_MUITOOLKIT_H
  9. #define LIBRARIES_MUITOOLKIT_H
  10.  
  11. #ifndef LIBRARIES_MUI_H
  12. #include <libraries/mui.h>
  13. #endif
  14.  
  15.  
  16. #define MUITOOLKIT_NAME "muitoolkit.library"
  17. #define MUITOOLKIT_VMIN 2
  18.  
  19.  
  20. /* some useful macros */
  21.  
  22. #ifndef NO_MT_MACROS
  23.  
  24. #define getmutex(obj)       mt_Get( obj,MUIA_Radio_Active )
  25. #define getcycle(obj)       mt_Get( obj,MUIA_Cycle_Active )
  26. #define getstring(obj)      (char *)mt_Get( obj, MUIA_String_Contents )
  27. #define getcheckmark(obj)   mt_Get( obj,MUIA_Selected )
  28. #define getslider(obj)      mt_Get( obj,MUIA_Numeric_Value )
  29. #define gettext(obj)        (char *)mt_Get((obj), MUIA_Text_Contents)
  30. #define copystring(dst,obj) strcpy((dst), (char *)mt_Get((obj), MUIA_String_Contents))
  31.  
  32. #define settext(obj,val)    set(obj, MUIA_Text_Contents, val)
  33. //#define gettext(obj)        (char *)mt_Get( obj, MUIA_Text_Contents )
  34. #define getnumstring(obj)   mt_Get((obj), MUIA_String_Integer)
  35.  
  36. #define mt_Sleep(obj)       set(app, MUIA_Application_Sleep, (obj))
  37.  
  38. #define mt_Disable(obj)     set((obj), MUIA_Disabled, TRUE)
  39. #define mt_Enable(obj)      set((obj), MUIA_Disabled, FALSE)
  40.  
  41. #endif
  42.  
  43.  
  44. //
  45.  
  46.  
  47. #ifndef MAKE_ID
  48. #define MAKE_ID(a,b,c,d)        \
  49.         ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  50. #endif
  51.  
  52.  
  53.  
  54. // macros defined to pair existsing MuiToolkit library calls
  55.  
  56. #define mt_WinClose(obj)           set( (obj), MUIA_Window_Open, FALSE )
  57. #define mt_StringNumeric(a,b,c,d)  mt_StringAccept((a),(b),(c), "-0123456789", (d) )
  58.  
  59.  
  60. /* Object backgrounds */
  61.  
  62. #define WindowBack     MUIA_Background, MUII_WindowBack
  63. #define RequesterBack  MUIA_Background, MUII_RequesterBack
  64. #define ButtonBack     MUIA_Background, MUII_ButtonBack
  65. #define ListBack       MUIA_Background, MUII_ListBack
  66. #define TextBack       MUIA_Background, MUII_TextBack
  67. #define PropBack       MUIA_Background, MUII_PropBack
  68. #define PopupBack      MUIA_Background, MUII_PopupBack
  69. #define SelectedBack   MUIA_Background, MUII_SelectedBack
  70. #define RegisterBack   MUIA_Background, MUII_RegisterBack
  71. #define TapePlayBack   MUIA_Background, MUII_TapePlayBack
  72. #define GroupBack      MUIA_Background, MUII_GroupBack
  73. #define SliderBack     MUIA_Background, MUII_SliderBack
  74. #define PageBack       MUIA_Background, MUII_PageBack
  75. #define ReadListBack   MUIA_Background, MUII_ReadListBack
  76.  
  77.  
  78.  
  79. #define HBar           MUI_MakeObject( MUIO_HBar, 2)
  80. #define VBar           MUI_MakeObject( MUIO_VBar, 2)
  81.  
  82.  
  83. #define Bar            MUI_MakeObject(MUIO_BarTitle, NULL)
  84. #define BarTitle(x)    MUI_MakeObject(MUIO_BarTitle, (x))
  85.  
  86.  
  87. /* sets w/o triggering any notification */
  88.  
  89. #define nnsetmutex(obj,n)     nnset(obj,MUIA_Radio_Active,n)
  90. #define nnsetcycle(obj,n)     nnset(obj,MUIA_Cycle_Active,n)
  91. #define nnsetstring(obj,s)    nnset(obj,MUIA_String_Contents,s)
  92. #define nnsetcheckmark(obj,b) nnset(obj,MUIA_Selected,b)
  93. #define nnsetslider(obj,l)    nnset(obj,MUIA_Numeric_Value,l)
  94.  
  95.  
  96.  
  97. /* window IDs used by internal MT's windows */
  98.  
  99. #define ID_MT_STRREQ    MAKE_ID('M','T','0','0')
  100. #define ID_MT_INTREQ    MAKE_ID('M','T','0','1')
  101.  
  102.  
  103.  
  104. /* Tags */
  105.  
  106. #ifndef CARLOS_MUI
  107. #define CARLOS_MUI
  108.  
  109. #define MUISERIALNR_CARLOS 2447
  110. #define TAGBASE_CARLOS (TAG_USER | ( MUISERIALNR_CARLOS << 16))
  111. #define MT TAGBASE_CARLOS + 0x100
  112. #define MTT(a) (MT + a)
  113. #endif
  114.  
  115.  
  116. #define mt_StrReq_WinTitle     MTT(0x000)    /* STRPTR */
  117. #define mt_StrReq_Contents     MTT(0x001)    /* STRPTR */
  118. #define mt_StrReq_Ok           MTT(0x002)    /* STRPTR */
  119. #define mt_StrReq_Cancel       MTT(0x003)    /* STRPTR */
  120. #define mt_StrReq_Secret       MTT(0x004)    /* BOOL   */
  121. #define mt_StrReq_NoEmpty      MTT(0x005)    /* BOOL   */
  122. #define mt_StrReq_GroupTitle   MTT(0x006)    /* STRPTR */
  123. #define mt_StrReq_Info         MTT(0x007)    /* STRPTR */
  124. #define mt_StrReq_StringHelp   MTT(0x008)    /* STRPTR */
  125.  
  126. #define mt_IntReq_WinTitle     MTT(0x010)    /* STRPTR */
  127. #define mt_IntReq_Value        MTT(0x011)    /* LONG   */
  128. #define mt_IntReq_Ok           MTT(0x012)    /* STRPTR */
  129. #define mt_IntReq_Cancel       MTT(0x013)    /* STRPTR */
  130. #define mt_IntReq_GroupTitle   MTT(0x014)    /* STRPTR */
  131. #define mt_IntReq_Min          MTT(0x015)    /* LONG   */
  132. #define mt_IntReq_Max          MTT(0x016)    /* LONG   */
  133. #define mt_IntReq_Info         MTT(0x017)    /* STRPTR */
  134. #define mt_IntReq_StringHelp   MTT(0x018)    /* STRPTR */
  135.  
  136.  
  137. // mt_Check - aligment
  138.  
  139. #define mt_Check_NoLabel       0
  140. #define mt_Check_AlignRight    1
  141. #define mt_Check_AlignLeft     2
  142.  
  143.  
  144. // the trickery
  145.  
  146. #pragma tagcall MuiToolkitBase mt_GetString 96 A09804
  147. #pragma tagcall MuiToolkitBase mt_GetInteger 9c A9803
  148.  
  149. #endif /* LIBRARIES_MUITOOLKIT_H */
  150.